import cv2


img = cv2.imread('/media/fang/Samsung USB/G410D-0614/G410D-0614/tsr/img/Europe/edge/d_00151_0_46.jpg')

rect_str = [['x=127, y=114, w=71, h=101'], ['x=89, y=124, w=45, h=91']]

rect_int = []
for rect in rect_str:
    idxS = rect[0].split(', ')
    for i in range(len(idxS)):
        idxS[i] = int(idxS[i].split('=')[-1])
    rect_int.append([[idxS[0], idxS[1]], [idxS[0] + idxS[2], idxS[1] + idxS[3]]])
for p in rect_int:
    cv2.rectangle(img, p[0], p[1], (0, 0, 255), 1)
cv2.imshow('img', img)
cv2.waitKey(0)
